<template>
  <div class="fixed" v-dialogDrag>
    <div class="content el-dialog"
         style="padding:0">
      <div class="msgTop el-dialog__header">
        <span>是否有责</span>
        <i class="el-icon-close fr"
           style="cursor:pointer;line-height:40px;font-size:13px;"
           @click="cancelTransfer"></i>
      </div>
      <el-form class="demo-ruleForm"
               style="padding:20px 20px 0 20px"
               label-width="100px">
        <!-- <el-form-item label="填写意见:" label-width="60px" prop="menuDesc">
          <el-input
            type="textarea"
            v-model="ruleForm.menuDesc"
            style="width:500px"
            :autosize="{ minRows: 3}"
          ></el-input>
        </el-form-item>-->
        <el-form-item label="是否有责："
                      label-position="left"
                      label-width="120px">
          <el-radio v-model="radio"
                    label="有责">是</el-radio>
          <el-radio v-model="radio"
                    label="无责">否</el-radio>
        </el-form-item>
        <el-form-item label-width="
                    10px"
                      class="center">
          <el-button @click="submitForm('ruleForm')"
                     type="button"
                     class="el-button el-button--primary el-button--medium h30Btn ">确定</el-button>
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>

<script>
import { workOrderLogAdd } from '@/api/WorkOrderUrgeController'
export default {
  data () {
    return {
      radio: '有责',
      workOrderIdList: ''
    }
  },
  mounted () {
  },
  methods: {
    cancelTransfer () {
      this.$emit('changeShow', false)
    },
    submitForm (formName) {
      this.workOrderIdList = this.$store.state.orderDetailsId
      let params = {
        content: this.radio,
        logType: '6', // 是否有责6
        workOrderId: this.workOrderIdList,
        logCreaterId: this.$store.state.userId,
        // relationOrg: sessionStorage.getItem('institution')
      }
      workOrderLogAdd(params).then(res => {
        if (res.data.retCode === 200) {
          this.$message({
            type: 'success',
            message: res.data.msg
          })
          this.$emit('changeShow', false)
        } else {
          this.$message({
            type: 'error',
            message: res.data.msg
          })
        }
      })
    }
  }
}
</script>
<style scoped>
.center {
  text-align: center;
  font-size: 16px;
}
.paging-foot {
  padding: 10px 0;
}
</style>
